package com.tech4u.cat4u;

import android.os.Bundle;
import android.util.Log;

import com.quyuanfactory.xvaide.XVAide;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

public class SecondActivity extends AppCompatActivity {

    XVAide.CallBack callBack = new XVAide.CallBack() {
        @Override
        public void aideLoaded(boolean b) {
            float[] rect = new float[]{0.79f, 0.79f, 0.2f, 0.2f};
            XVAide.ShowModelRect(rect);
            XVAide.ShowModel();

            XVAide.Animate("Tou", 1000);
        }

        @Override
        public void aideClicked(String s) {
            Log.e("dime", "aideClicked:" + s);
//            XVAide.Animate(s,20.0f);
            if(s.equals("Tou")){
                XVAide.StopAnimatePose("Manual","Tou"); //stop pose animation, reset, not necessary!, for demo
                XVAide.Animate("Nod",20.0f);
            }else if(s.equals("qunzi")){
                XVAide.Animate("Great",20.0f);
            }else if(s.equals("Leg")){
                XVAide.Animate("Walk",20.0f);
            }

        }

        @Override
        public void aideDoubleClicked(String s) {

        }

        @Override
        public void animateFinished(String s) {
            Log.e("dime", "animateFinshed:" + s);
        }
    };

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_second);


        XVAide.Init(this, callBack);


    }

    @Override
    public void onBackPressed() {
        super.onBackPressed();
        finish();
    }
}
